Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language Reference
Chapter 7 - Control Statements / Repeat Statements


Exit

An Exit statement is used in a Repeat statement to exit the Repeat statement. When AppleScript executes an Exit statement, it terminates loop execution and resumes execution with the next statement following the Repeat statement. You cannot use Exit statements outside of Repeat statements.

SYNTAX
exit
EXAMPLE
set i to 1
tell application "Scriptable Text Editor"   repeat
      if i > (count windows)
         exit
      end
      print window i
      set i to i + 1
   end repeat
end tell

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996